<%@ page language="java" import="java.sql.*" %>
<%@include file="connection.jsp" %>
<%
	String txtuser = request.getParameter("txtusername");
	String txtpass = request.getParameter("txtpassword");
	
	
	try {
		rs = stmt.executeQuery("SELECT username,password FROM t_user where " +
				"username='"+txtuser+"' and password=md5('"+ txtpass +"') ");		
	if (rs.next())	
	{
	HttpSession ses = request.getSession(true);
			ses.putValue("ses_uname",rs.getString(1));
	String redirectURL = "index.jsp";
	response.sendRedirect(redirectURL);
	}
	else
	{
	out.println("error login");
	}
	}
	catch(Exception e)
	{
		out.println(e);
	}
	
%>